home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 04 - 1988 / 04.10 Oct 88 / TransferSources / drvrhead.asm < prev    next >
Encoding:
Assembly Source File  |  1988-05-22  |  2.3 KB  |  102 lines  |  [TEXT/MPS ]

  1. ;*******************************************************************
  2. ;
  3. ;    drvrhead.asm
  4. ;    ------------
  5. ;
  6. ;    (c) 1987, 1988 Attic Software
  7. ;
  8. ;    header for DRVR segment of Transfer.
  9. ;
  10. ;*******************************************************************
  11.  
  12. ;*******************************************************************
  13. ;    includes
  14. ;*******************************************************************
  15.  
  16.     include        sysequ.d
  17.     include        types.asm
  18.  
  19. ;*******************************************************************
  20. ;    inported routines
  21. ;*******************************************************************
  22.  
  23.     xref        open
  24.     xref        ctl
  25.  
  26. ;*******************************************************************
  27. ;    exported routines
  28. ;*******************************************************************
  29.  
  30.     xdef        initglobals
  31.     xdef        setdir
  32.  
  33. ;*******************************************************************
  34. ;
  35. ;    The canonical DA header.  This is a modified version of
  36. ;    the DA header supplied with TML Pascal.
  37. ;
  38. ;*******************************************************************
  39.  
  40.     dc.w        $0400        ; flags 
  41.     dc.w        $0000        ; service rate
  42.     dc.w        $ffff        ; event mask
  43.     dc.w        $0000        ; menuID goes here
  44.     dc.w        ornopen        ; open routine
  45.     dc.w        orndone        ; prime
  46.     dc.w        ornctl        ; Control
  47.     dc.w        orndone        ; Status
  48.     dc.w        ornclose    ; close
  49.  
  50. ;*******************************************************************
  51.  
  52.     dc.w        '(c) 1987, 1988 Attic Software'
  53.     dc.w        'All rights reserved'
  54.  
  55. ;*******************************************************************
  56.  
  57. ornopen    
  58.     movem.l        A0/A1,-(SP)
  59.     move.l        A1,-(SP)    ; stack device
  60.     move.l        A0,-(SP)    ; stack param            
  61.     jsr        open
  62.     movem.l        (SP)+,A0/A1
  63.     move.l        jiodone,-(SP)
  64.     rts
  65.  
  66. ornctl        
  67.     movem.l        A0/A1,-(SP)
  68.     move.l        A1,-(SP)    ; stack device
  69.     move.l        A0,-(SP)    ; stack param            
  70.     jsr        ctl
  71.     movem.l        (SP)+,A0/A1
  72.     move.l        jiodone,-(SP)
  73.     rts
  74.  
  75. ornclose
  76. orndone
  77.     move.l        jiodone,-(SP)
  78.     rts
  79.  
  80. ;*******************************************************************
  81. ;
  82. ;    The routine loader moves a selector into D0, and the
  83. ;    address of the PACK segment into A0.  It then jumps to
  84. ;    the pack (the pack begins with a jump table).
  85. ;
  86. ;*******************************************************************
  87.  
  88. initglobals
  89.     move.w        #0,D0
  90.     bra.w        loader
  91.  
  92. setdir
  93.     move.w        #4,D0
  94.     bra.w        loader
  95.  
  96. loader
  97.     movea.l        4(SP),A0    ; globals
  98.     movea.l        WRpackaddr(A0),A0
  99.     jmp        (A0)
  100.  
  101. ;*******************************************************************
  102.